<?php

class job
{
    public function do($obj){

        $i=0;
        while(true){
            $i++;
            file_put_contents("./txt","{$i} [before ] ".posix_getpid().PHP_EOL,FILE_APPEND);
            sleep(5);
            file_put_contents("./txt","{$i} [after  ] ".posix_getpid().PHP_EOL,FILE_APPEND);

        }
    }
}